import 'package:flutter_nb_net/flutter_net.dart';

class LoginResp extends BaseNetModel {
  int? code;
  String? msg;
  LoginData? data;

  LoginResp({this.code, this.msg, this.data});

  LoginResp.name(this.code, this.msg, this.data);

  @override
  fromJson(Map<String, dynamic> json) {
    return LoginResp(
      code: json['code'],
      msg: json['msg'],
      data: json['data'] == null ? null : LoginData().fromJson(json['data']),
    );
  }
}

class LoginData extends BaseNetModel {
  String? nickname;
  String? token;
  String? type;
  int? userId;
  String? appId;
  String? phone;

  LoginData({this.nickname, this.token, this.type, this.userId, this.appId, this.phone});

  @override
  fromJson(Map<dynamic, dynamic> json) {
    return LoginData(
      nickname: json['nickname'],
      token: json['token'],
      type: json['type'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'nickname': nickname,
      'token': token,
      'type': type,
      'userId': userId,
      'appId': appId,
      'phone': phone,
    };
  }
}
